Practice Set 1

We'll cover the following

Practice Set 1#

We’ll build upon the MovieIndustry database we have been working with throughout the lesson. We’ll add two more tables for a total of four. The relations between the tables are pictorially depicted below.

widget

Connect to the terminal below by clicking in the widget. Once connected, the command line prompt will show up. Enter or copy and paste the command ./DataJek/Lessons/quiz.sh and wait for the MySQL prompt to start-up.

Terminal 1
Terminal

Click to Connect...

Write and execute queries for the following questions:

  1. Write a query that prints the top three movies by box office collection?

Expected Result:

Name
movie 1
movie 2
movie 3
  1. Can you write a query to determine if any two actors share the same second name?

Expected Result:

Actors_With_Shared_SecondNames
actor 1
actor 2
actor n
  1. Write a query to count the number of actors who share the same second name. Print the second name along with the count.

Expected Result:

Actors_With_Shared_SecondNames Count
second name 1 cnt#1
second name 2 cnt#2
second name n cnt#n
  1. Write a query to display all those actors who have acted in at least one movie.

Expected Result:

Actors_Acted_In_Atleast_1_Movies
actor 1
actor 2
actor n
  1. As a corollary to the previous question, can you find the different ways of listing those aspiring actors who haven’t acted in any movie yet?

Expected Result:

Actors_With_No_Movies
actor 1
actor 2
actor n
Quiz 16
Solution Practice Set 1
Mark as Completed
Report an Issue